package org.example;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class NumberInfo implements Writable {
    private Long Confirmed; //已确诊，累计
    private Long Deaths; //死亡，累计
    private Long Health; //恢复，累计
    private String Province; //省份


    public NumberInfo() {
    }

    public NumberInfo(Long confirmed, Long deaths, Long health, String province) {
        Confirmed = confirmed;
        Deaths = deaths;
        Health = health;
        Province = province;
    }

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeLong(Confirmed);
        dataOutput.writeLong(Deaths);
        dataOutput.writeLong(Health);
        dataOutput.writeUTF(Province);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        Confirmed = dataInput.readLong();
        Deaths = dataInput.readLong();
        Health = dataInput.readLong();
        Province = dataInput.readUTF();
    }

    @Override
    public String toString() {
        return Confirmed + "\t" + Deaths + "\t" + Health + "\t" + Province;
    }

    public Long getConfirmed() {
        return Confirmed;
    }

    public void setConfirmed(Long confirmed) {
        Confirmed = confirmed;
    }

    public Long getDeaths() {
        return Deaths;
    }

    public void setDeaths(Long deaths) {
        Deaths = deaths;
    }

    public Long getHealth() {
        return Health;
    }

    public void setHealth(Long health) {
        Health = health;
    }

    public String getProvince() {
        return Province;
    }

    public void setProvince(String province) {
        Province = province;
    }
}
